﻿@{
    Layout = null;
}
@using 省市级联.Controllers
@model Business
<script src="~/jquery-1.10.2.min.js"></script>
<div class="text-center">
    <h1 class="display-4">Welcome</h1>
    <p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
@Html.GetAddress(Model => Model.ProviceID, Model => Model.CityID, Model => Model.DistrictID, new { })

<script type="text/javascript">
    function ProChange(Pro) {
        $.post("/home/GetAddressSlect", { id: $(Pro).val(), type: 0 }, function (data) {
            if (data.succ) {
                $("#city").html(""); $("#city").html(data.str);
                CityChange($("#city"));
            }
        });
    }

    function CityChange(City) {
        $.post("/home/GetAddressSlect", { id: $(City).val(), type: 1 }, function (data) {
            if (data.succ) {
                $("#dis").html(""); $("#dis").html(data.str);
            }
        });
    }

    $(function () {
        //ProChange($("#pro"));
    });
</script>